package com.zhentao.controller;


import com.zhentao.model.user.dto.LoginDto;
import com.zhentao.model.dtos.ResponseResult;
import com.zhentao.model.user.pojo.ApUser;
import com.zhentao.service.ApuserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("/api/v1/login")
public class ApUserLoginController {


    @Autowired
    private ApuserService apuserService;


    /**
     * 登录
     */

    @PostMapping("/login_auth")
    public ResponseResult login(@RequestBody LoginDto loginDto) {
        return apuserService.login(loginDto);
    }

    /**
     * 注册
     */
    @PostMapping("/register_auth")
    public ResponseResult register(@RequestBody ApUser apUser) {
        return apuserService.register(apUser);
    }

}
